package com.atguigu.start.teststartmodule19.controller;

import com.atguigu.start.service.AgeService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MyController {
    @Autowired
    private AgeService ageService;
    @Value("${atguigu.birthday}")
    private String birthday;
    @RequestMapping("/birthday/test")
    public String test() {
        int age = ageService.computeAgeByBirthday();
        return birthday + "日期的生日的人的年龄是 = " + age;
    }

}
